<?php $this->_extends('../_layouts/default_layout'); ?>
<?php $this->_block('contents'); ?>
<script type="text/javascript">
$(function(){
	$(".info").colorbox({width:"70%", height:"90%", iframe:true});
});
</script>
<fieldset><legend>查询条件</legend>
<form action="" method="get">
<? include(Q::ini('custom_system/elements_dir') . 'searchform_element.php');?>
<table class="form_table">
<tr>
	<th>仓库</th>
	<td>
		<?foreach ($warehouse as $w):?>
		<label><input type="checkbox" name="warehouse_id[<?=$w['id']?>]" value="<?=$w['id']?>" <?if (isset($_GET['warehouse_id']) && in_array($w['id'], $_GET['warehouse_id']))echo "checked='checked'"?>/> <?=$w['name']?></label>
		<?endforeach;?>
	</td>
</tr>
<tr>
	<th>状态</th>
	<td>
		<label><input type="checkbox" name="status[1]" value="1" <?if (isset($_GET['status']) && in_array(1, $_GET['status']))echo "checked='checked'"?>/> 上线</label>
		<label><input type="checkbox" name="status[0]" value="0" <?if (isset($_GET['status']) && in_array(0, $_GET['status']))echo "checked='checked'"?>/> 下线</label>
	</td>
</tr>
<tr>
	<th></th>
	<td><input type="submit" class="button" value="查询" /></td>
</tr>
</table>
</form>
</fieldset>
<a href="<?=url('Setting::Basic/ShippingMethodCreate')?>" class="info">添加新邮寄方式</a>
<table width="100%" class="list_table">
<tr>
	<th>ID</th>
	<th>名称</th>
	<th>代号</th>
	<th>所在仓</th>
	<th>状态</th>
	<th>打印</th>
	<th>排序</th>
	<th width="80">操作</th>
</tr>
<? foreach($shipping_method as $s):?>
<tr>
	<td><?=$s['id'];?></td>
	<td><?=$s['name'];?></td>
	<td><?=$s['code'];?></td>
	<td><?=$s['warehouse_name']?></td>
	<td><?=($s['status'] == true) ? '上线' : '下线'?></td>
	<td><?=$s['address_model']?></td>
	<td><?=$s['sort']?></td>
	<td>
		<a href="<?=url('Setting::Basic/ShippingMethodCreate', array('id' => $s['id']))?>" class="info">修改</a>
	</td>
</tr>
<? endforeach;?>
</table>
<?php $this->_endblock(); ?>